package 多线程.线程状态.sleep和yield和join;
 import java.lang.Thread.State;
/**
 *
 * 观察线程状态
 *
 * */
public class AllState {
    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            for (int i = 0; i < 5; i++) {
                System.out.println("111");
            }
        });

        State state = t1.getState();
        System.out.println(state);//NEW
        t1.start();

        state = t1.getState();
        System.out.println(state);//RUNNABLE
    }
}
